Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auxilery memory address verification #418

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Conversation

ohad-starkware
Copy link
Contributor

@ohad-starkware ohad-starkware commented Jan 30, 2025

This change is Reviewable

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ohad-starkware ohad-starkware self-assigned this Jan 30, 2025
@ilyalesokhin-starkware
Copy link
Collaborator

stwo_cairo_prover/crates/prover/src/components/memory/memory_address_to_id/component.rs line 29 at r1 (raw file):

/// ID3 = [id9, id10, 0, 0]
pub const LOG_ADDRESS_TO_ID_N_SPLIT_CHUNKS: u32 = 3;
pub(super) const N_SPLIT_CHUNKS: usize = 1 << LOG_ADDRESS_TO_ID_N_SPLIT_CHUNKS;

is there a reason for this to be a power of 2?

Code quote:

N_SPLIT_CHUNKS

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @ohad-starkware)

Copy link
Contributor Author

@ohad-starkware ohad-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware and @ohad-starkware)


stwo_cairo_prover/crates/prover/src/components/memory/memory_address_to_id/component.rs line 29 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

is there a reason for this to be a power of 2?

no :)

@ilyalesokhin-starkware
Copy link
Collaborator

stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs line 135 at r2 (raw file):

    assert!(
        1 << claim.memory_address_to_id.log_size
            <= (1 << LOG_MEMORY_ADDRESS_BOUND) / MEMORY_ADDRESS_TO_ID_SPLIT

Suggestion:

        (1 << claim.memory_address_to_id.log_size) * MEMORY_ADDRESS_TO_ID_SPLIT
            <= (1 << LOG_MEMORY_ADDRESS_BOUND)

Copy link
Contributor Author

@ohad-starkware ohad-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware and @ohad-starkware)


stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs line 135 at r2 (raw file):

    assert!(
        1 << claim.memory_address_to_id.log_size
            <= (1 << LOG_MEMORY_ADDRESS_BOUND) / MEMORY_ADDRESS_TO_ID_SPLIT

Done.

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 3 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ohad-starkware)

@ohad-starkware ohad-starkware merged commit aad7b33 into main Feb 4, 2025
7 checks passed
@ohad-starkware ohad-starkware deleted the ohad/aux_verify branch February 4, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants